import service from './service';

/**
 * 支付宝申请退款
 * @param spaceid 当前项目的spaceid
 * @param out_trade_no 订单单号
 * @param refund_amount 退款金额（需要退款的金额，该金额不能大于订单金额,单位为元，支持两位小数）
 * @param out_refund_no 退款单号
 * @example const res=await ali_refunds(out_trade_no, refund_amount, out_refund_no);
 */
export default function ali_refunds(out_trade_no: string, refund_amount: number, out_refund_no: string) {
	const param = {
		bizcontent: {
			out_trade_no,
			refund_amount,
			refund_reason: '',
			trade_no: ''
		},
		flag: '207',
		out_refund_no,
		thirdpay_type: 'alipay_refunds'
	};
	return service('payservice.thirdpayment', param, false, false);
}
